﻿@namespace ThingsGateway.Admin.Razor
@using ThingsGateway.Admin.Application
<div class="row g-2 mx-1 form-inline">

    <div class="col-12  col-md-6">
        <BootstrapInput @bind-Value="Model.Title"></BootstrapInput>
    </div>
    @if (Model.Category != ResourceCategoryEnum.Module)
    {
        <div class="col-12  col-md-6">
            <ParentMenu @bind-Value="Model.ParentId" Lookup="@ParementMenus" ModuleId=ModuleId DisplayText=@(Model.GetType().GetPropertyDisplayName(nameof(Model.ParentId)))></ParentMenu>
        </div>
    }
    <div class="col-12  col-md-6">
        <Select @bind-Value="Model.Category" IsPopover></Select>
    </div>

    @if (Model.Category != ResourceCategoryEnum.Button)
    {
        <div class="col-12  col-md-6">
            <BootstrapInputGroup>
                <label class="form-label">@Model.GetType().GetPropertyDisplayName(nameof(Model.Icon))</label>
                <i class="text-info d-flex  align-items-center me-2  @Model.Icon" style="flex: 0 0 auto;"></i>
                <BootstrapInput @bind-Value="Model.Icon"> </BootstrapInput>
                <Button class="text-end" Icon="fa-solid fa-xmark" Color="Color.Secondary" OnClick="@(()=>Model.Icon=null)"></Button>
                <Button class="text-end" Icon="fa-solid fa-bars" OnClick="OnToggleIconDialog"></Button>
            </BootstrapInputGroup>
        </div>
    }
    @if (Model.Category == ResourceCategoryEnum.Menu)
    {
        <div class="col-12">
            <BootstrapInput @bind-Value="Model.Href"></BootstrapInput>
        </div>
        <div class="col-12  col-md-6">
            <Select @bind-Value="Model.Target" IsPopover></Select>
        </div>
        <div class="col-12  col-md-6">
            <Select @bind-Value="Model.NavLinkMatch" IsPopover></Select>
        </div>

    }
@*     @if (Model.Category == ResourceCategoryEnum.Button)
    {
        <div class="col-12  col-md-6">
            <BootstrapInput @bind-Value="Model.Code"></BootstrapInput>
        </div>
    } *@
    <div class="col-12  col-md-6">
        <BootstrapInput @bind-Value="Model.SortCode"></BootstrapInput>
    </div>
</div>





